package com.ww7h.mvvm

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment

/**
 * ================================================
 * 描述：
 * 来源：     Android Studio.
 * 项目名：   bo-an-poj-common
 * 包名：     com.ww7h.mvvm
 * 创建时间：  2020/11/26 01:32
 * @author   ww
 * ================================================
 */
abstract class ViewFragment<VB: ViewDataBinding>: Fragment(), ViewCommon {

    protected lateinit var defaultViewDataBinding: VB

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        defaultViewDataBinding = getViewDataBinding(inflater, container, getContentViewLayoutId())
        return defaultViewDataBinding.root
    }

    abstract fun getContentViewLayoutId():Int

}